# $Id$
#Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=xorg-fonts-encodings
pkgver=1.0.4
pkgrel=4
pkgdesc="X.org font encoding files"
arch=(any)
url="https://xorg.freedesktop.org/"
license=('custom')
makedepends=('xorg-mkfontscale' 'xorg-util-macros' 'xorg-font-util')
groups=('xorg-fonts' 'xorg')
options=(!makeflags)
source=(${url}/releases/individual/font/encodings-${pkgver}.tar.bz2)
sha1sums=('24ace2470403f85a0d393769204029bd8247992a')

build() {
  cd "${srcdir}/encodings-${pkgver}"
  ./configure --prefix=/usr
  make
}

package() {
  cd "${srcdir}/encodings-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"

  # regenerate encodngs file not to include non-compressed versions
  cd $pkgdir/usr/share/fonts/encodings/large
  mkfontscale -b -s -l -n -r -p /usr/share/fonts/encodings/large -e . .
  cd $pkgdir/usr/share/fonts/encodings/
  mkfontscale -b -s -l -n -r -p /usr/share/fonts/encodings -e . -e large .
}
